#ifndef _STRATEGY_H_
#define _STRATEGY_H_ 1
#include <string>
#include <vector>
#include <iostream>
class FormatStrategy{
public:
  virtual std::string 
  filt(std::string context) = 0;
};
class LangStrategy{
public:
  virtual std::vector<std::string> 
  check(std::string context) = 0;
};
class TXTStrategy:FormatStrategy{
public:
   static FormatStrategy 
   *instance(){
     if(inst == NULL){
       inst = new TXTStrategy();
    }
     return inst;
   };
   inline static void 
   destroy_instance(){
     if(inst != NULL)
       delete inst;
     inst = NULL;
   }
   inline std::string 
   filt(std::string context){
     return context;
   };
private:
   TXTStrategy(){
   };
   static TXTStrategy *inst;
};
class XMLStrategy:FormatStrategy{
public:
   static FormatStrategy 
   *instance(){
     if(inst == NULL)
       inst = new XMLStrategy();
     return inst;
   };
   inline static void 
   destroy_instance(){
     if(inst != NULL)
       delete inst;
     inst = NULL;
   }
   std::string 
   filt(std::string context);
private:
   XMLStrategy(){
   }
   static XMLStrategy *inst;
};
class LocalStrategy : public LangStrategy{
public:
  static LangStrategy  
  *instance(std::string str){
    if(inst == NULL)
      inst = new LocalStrategy();
    inst->lexicon = str;
    return inst;
  }
  inline static void 
  destroy_instance(){
    if(inst != NULL)
      delete inst;
   }
  std::vector<std::string>  
  check(std::string context);
private:
  LocalStrategy(){
  }
  static LocalStrategy *inst;
  std::string lexicon;
};
#endif
